#version 150

in vec4 iVertex;
in vec3 iColor;
in vec3 iNormal;

uniform mat4 uMVPMatrix;
uniform mat4 uMVMatrix;

out vec3 vColor;

void main()
{
    vec3 lNorm=vec3(uMVMatrix*vec4(iNormal,0));
    lNorm=normalize(lNorm);
    float lIntensity=abs(dot(lNorm,vec3(0,0,1)));

    vColor=lIntensity*iColor+0.3*iColor;
    gl_Position=uMVPMatrix*iVertex;
}
